package com.zixuan.gulicollege.cmsservice.controller;


import com.zixuan.gulicollege.cmsservice.service.CrmBannerService;
import com.zixuan.gulicollege.common_utils.R;
import com.zixuan.gulicollege.entity.cms.CrmBanner;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 首页banner表 前端控制器
 * </p>
 *
 * @author zixuan
 * @since 2021-05-16
 */
@RestController
@RequestMapping("/cms_service/banner")
public class CrmBannerFrontController {

    @Autowired
    private CrmBannerService bannerService;

    /**
     * 查询所有banner
     * @return
     */
    @GetMapping("/getAllBanner")
    public R getAllBanner() {
        List<CrmBanner> bannerList = bannerService.selectAllBanner();
        return R.ok().data("bannerList", bannerList);
    }

}

